package acount;

import book.Booklist;
import operation.IOperation;
import operation.*;

public class Admin extends User {
    public void menu() {
        System.out.println("1.添加图书信息");
        System.out.println("2.删除图书信息");
        System.out.println("3.修改图书信息");
        System.out.println("4.查看所有图书");
        System.out.println("0.退出");
        System.out.print("请输入操作对应的数字：");
    }

    /**
     * 构造方法
     */
    public Admin() {
        this.iOperations = new IOperation[6];
        iOperations[0] = new Exit();
        iOperations[1] = new Add();
        iOperations[2] = new Delete();
        iOperations[3] = new Modify();
        iOperations[4] = new Display();
    }

    @Override
    public void operate(int c, Booklist booklist) {
        /**
         * 表示调用父类的operate方法，父类中已经对operate指定了使用方法
         * 即this.iOperations[c].work(booklist);
         */
        super.operate(c, booklist);
    }
}
